Developer Documentation

QuickTime 4 API Documentation

QuickTime 4 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Movie Data Exchange Component Functions


Exporting Text

This section describes new functions provided by text export components.


TextExportGetDisplayData

The TextExportGetDisplayData function retrieves text display information for the current sample in the specified text export component.

pascal ComponentResult TextExportGetDisplayData (
                     TextExportComponent ci,
                     TextDisplayData *textDisplay);

ci
Specifies the text export component for this operation. Applications obtain this reference from the Component Manager's OpenComponent function.
textDisplay
Contains a pointer to a text display data structure. On return, this structure contains the display settings of the current text sample. For more information, see "Text Display Data Structure" .

DISCUSSION

You call this function to retrieve the text display data structure for a text sample. The text display data structure contains the formatting information for the text sample. When the text export component exports a text sample, it uses the information in this structure to generate the appropriate text descriptors for the sample. Likewise, when the text import component imports a text sample, it sets the appropriate fields in the text display data structure based on the sample's text descriptors.

RESULT CODES

Component Manager errors, as documented in Mac OS For QuickTime Programmers .


TextExportGetTimeFraction

The TextExportGetTimeFraction function retrieves the time scale the specified text export component uses to calculate time stamps.

pascal ComponentResult TextExportGetTimeFraction (
                     TextExportComponent ci,
                     long *movieTimeFraction);

ci
Specifies the text export component for this operation.
movieTimeFraction
Contains a pointer to a 32-bit integer. On return, this integer contains the time scale used in the fractional part of time stamps.

DISCUSSION

You call this function to retrieve the time scale used by the text export component to calculate the fractional part of time stamps. You set a text component's time scale by specifying it in the Text Export Settings dialog box or by calling the TextExportSetTimeFraction function.

RESULT CODES

Component Manager errors, as documented in Mac OS For QuickTime Programmers .


TextExportSetTimeFraction

The TextExportSetTimeFraction function set the time scale the specified text export component uses to calculate time stamps.

pascal ComponentResult TextExportSetTimeFraction (
                     TextExportComponent ci,
                     long movieTimeFraction);

ci
Specifies the text export component for this operation.
movieTimeFraction
Specifies the time scale used in the fractional part of time stamps. The value should be between 1 and 10000, inclusive.

DISCUSSION

You call this function to set the time scale used by the text export component to calculate the fractional part of time stamps. You can also set a text component's time scale by specifying it in the text export settings dialog box. You can retrieve a text component's time scale by calling the TextExportGetTimeFraction function.

RESULT CODES

Component Manager errors, as documented in Mac OS For QuickTime Programmers .


TextExportGetSettings

The TextExportGetSettings function retrieves the value of the text export option for the specified text export component.

pascal ComponentResult TextExportGetSettings (
                     TextExportComponent ci,
                     long *setting);

ci
Specifies the text export component for this operation.
setting
Contains a pointer to a 32-bit integer. On return, this integer contains a constant that represents the current value of the text export option. Possible values are kMovieExportTextOnly , kMovieExportAbsoluteTime , and kMovieExportRelativeTime . For more information, see "Text Export Options" .

DISCUSSION

You call this function when exporting text to retrieve the current value of the text export option for the specified text export component. If the retrieved text export option is kMovieExportTextOnly , the text export component exports text without time descriptors or time stamps. If the retrieved text export option is either kMovieExportAbsoluteTime or kMovieExportRelativeTime , the text export component exports text along with its text descriptors and time stamps.

RESULT CODES

Component Manager errors, as documented in Mac OS For QuickTime Programmers .


TextExportSetSettings

The TextExportSetSettings function sets the value of the text export option for the specified text export component.

pascal ComponentResult TextExportSetSettings (
                     TextExportComponent ci,
                     long setting);

ci
Specifies the text export component for this operation.
setting
Specifies a constant that represents the current value of the text export option. Possible values are kMovieExportTextOnly , kMovieExportAbsoluteTime , and kMovieExportRelativeTime . For more information, see "Text Export Options" .

DISCUSSION

You call this function when exporting text to set the value of the text export option for the specified text export component. To export text only, without time descriptors or time stamps, you should set the setting parameter to kMovieExportTextOnly . To export text with text descriptors and absolute time stamps, you should set the setting parameter to kMovieExportAbsoluteTime . To export text with text descriptors and relative time stamps, you should set the setting parameter to kMovieExportRelativeTime .

RESULT CODES

Component Manager errors, as documented in Mac OS For QuickTime Programmers .


Importing Movie Data

This section describes new functions provided by movie data import components.


MovieImportGetFileType

The MovieImportGetFileType allows your movie data import component to tell the Movie Toolbox the appropriate file type for the most-recently imported movie file.

pascal ComponentResult MovieImportGetFileType (MovieImportComponent ci, OSType *fileType);
ci
Identifies the toolbox's connection to your movie data import component.
fileType
Contains a pointer to an OSType field. Your component should place the file type value that best identifies the movie data just imported. For example, Apple's Audio CD movie data import component sets this field to 'AIFF' whenever it creates an AIFF file instead of a movie file.

DISCUSSION

You should implement this function only if your movie data import component creates files other than QuickTime movies. By default, the toolbox makes new files movies, unless you override that default by providing this function.

Result CODES

badComponentSelector
0x80008002 Function not supported

MovieImportGetAuxiliaryDataType

The MovieImportGetAuxiliaryDataType function returns the type of the auxiliary data that it can accept. For example, calling the text import component with MovieImportGetAuxiliaryDataType indicates that the text import component will use 'styl' information in addition to 'TEXT' data.

pascal ComponentResult MovieImportGetAuxiliaryDataType(
                     MovieImportComponent ci,
                     OSType *auxType);

ci
Specifies the movie import component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
auxType
A pointer to the type of auxiliary data it can import.

RESULT Codes

badComponentInstance
0x80008001 Invalid movie import component instance
badComponentSelector
0x80008002 Function not supported

MovieImportGetMIMETypeList

Returns a list of MIME types supported by the movie import component.

pascal ComponentResult MovieImportGetMIMETypeList (
                     MovieImportComponent ci,
                     QTAtomContainer *mimeInfo);

ci
Specifies an instance of a movie import component.
mimeInfo
A pointer to a MIME type list, a QT atom container that contains a list of MIME types supported by the movie import component. The MIME type list structure is described in "MIME Type List" .
The caller should dispose of the atom container when finished with it.

DISCUSSION

Your movie import component can support MIME types that correspond to formats it supports. To make a list of these MIME types available to applications or other software, it must implement the MovieImportGetMIMETypeList function.

To indicate that your movie import component supports this function, set the hasMovieImportMIMEList flag in the componentFlags field of the component description record.

If your component includes a private component resource holding this MIME data, it can use GetComponentResource to retrieve it. If the resource is a public component resource, it can use either GetComponentPublicResource with the public type and ID or GetComponentResource with the private type and ID.

RESULT CODES

noErr
0 No error
paramErr
-50 Invalid parameter specified
memFullErr
-108 Not enough memory available
badComponentSelector
0x80008002 Component does not support the specified request code

MovieImportValidate

The MovieImportValidate function allows your movie data import component to validate the data to be passed to your component. Its purpose is to indicate whether or not the file or data can be imported by the component.

pascal ComponentResult MovieImportValidate(
                     MovieImportComponent ci,
                     const FSSpec *theFile,
                     Handle theData,
                     Boolean *valid);

ci
Specifies the movie import component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
theFile
Specifies the file to validate if the importer imports from files.
theData
Specifies the data to validate if the importer imports from handles.
valid
Contains a pointer to a Boolean value. If the data or file can be imported, the value returned is true . Otherwise, it returns false .

DISCUSSION

Movie import components can implement this function to allow applications to determine if a given file or handle to data is acceptable for a particular import component. As this function may be called on many files, the validation process should be as fast as possible.

RESULT Codes

badComponentInstance
0x80008001 Invalid movie import component instance
badComponentSelector
0x80008002 Function not supported

MovieImportValidateDataRef

The MovieImportValidateDataRef function lets your movie data import component validate the data file indicated by the data reference. This function allow the import to indicate if the file can be imported.

pascal ComponentResult MovieImportValidate( MovieImportComponent ci,
                     Handle dataRef,
                     OSType dataRefType,
                     Uint8 *valid);

ci
Specifies the movie import component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
dataRef
Specifies the data reference to the file to be validated.
dataRefType
Specifies the type of data reference for 'dataRef' .
valid
Contains a pointer to a Uint8 value. If the data or file cannot be imported, the value returned should be 0. Otherwise, it should be set to 128.

DISCUSSION

Movie import components can implement this function to allow applications to determine if a given file referenced by a data reference is acceptable for a particular import component. The data reference can refer to any data for which there is a suitable DataHandler component installed and available to QuickTime. As this function may be called on many files, the validation process should be as fast as possible. Furthermore, the importer should probably limit the amount of reading it performs, particularly when the data handler refers to data on the Internet.

Unlike MovieImportValidate , the valid parameter for this function is a value that can be interpreted as the degree to which the importer can interpret the file's contents. In all cases, returning 0 indicates the file cannot be interpreted by the importer. However, other nonzero values can be used to determine the relative weighting between multiple importers that can import a particular kind of file. For now, it is best to return either 0 or 128 only.

RESULT Codes

badComponentInstance
0x80008001 Invalid movie import component instance
badComponentSelector
0x80008002 Function not supported

MovieImportSetOffsetAndLimit

The MovieImportSetOffsetAndLimit function allows your application to specify the location and size of data that should be imported. Typically, this is used when the data is from a part of a file rather than the entire file.

pascal ComponentResult MovieImportSetOffsetAndLimit(
                     MovieImportComponent ci,
                     unsigned long offset,
                     unsigned long limit);

ci
Specifies the movie import component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
offset
A byte offset into the file that indicates where the import operation begins.
limit
A byte offset into the file that indicates the last data in the file that can be imported.

DISCUSSION

The MovieImportSetOffsetAndLimit function is especially useful when one file format is embedded in another; it allows your application to skip header data for the enclosing file and begin importing data at the start of the desired format.

Not all movie import components support the MovieImportSetOffsetAndLimit function. Those that do include the movie import components for the kQTFileTypeAIFF , kQTFileTypeWave , and kQTFileMuLaw file types. Those that do not return the badComponentSelector result code in response to a MovieImportSetOffsetAndLimit call.

RESULT Codes

badComponentInstance
0x80008001 Invalid movie import component instance
badComponentSelector
0x80008002 Function not supported

MovieImportSetOffsetAndLimit64

The MovieImportSetOffsetAndLimit64 function serves the same purpose as MovieImportSetOffsetAndLimit . The only difference is that the offset and limit can hold 64-bit offsets.

pascal ComponentResult MovieImportSetOffsetAndLimit(
                     MovieImportComponent ci,
                     wide * offset,
                     wide * limit);

ci
Specifies the movie import component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
offset
A byte offset into the file that indicates where the import operation begins.
limit
A byte offset into the file that indicates the last data in the file that can be imported.

DISCUSSION

The MovieImportSetOffsetAndLimit function is especially useful when one file format is embedded in another; it allows your application to skip header data for the enclosing file and begin importing data at the start of the desired format.

Not all movie import components support the MovieImportSetOffsetAndLimit function. Those that do not return the badComponentSelector result code in response to a MovieImportSetOffsetAndLimit call. Also, if MovieImportSetOffsetAndLimit64 function is not implemented and the offset and limit can be expressed using 32 bit offsets, MovieImportSetOffsetAndLimit should be tried.

RESULT Codes

badComponentInstance
0x80008001 Invalid movie import component instance
badComponentSelector
0x80008002 Function not supported

MovieImportGetSettingsAsAtomContainer

The MovieImportGetSettingsAsAtomContainer routine retrieves the current settings from the movie import component.

pascal ComponentResult MovieImportGetSettingsAsAtomContainer (
                    MovieImportComponent ci,
                    QTAtomContainer *settings);

ci
The movie import component instance.
settings
The address where the reference to the newly created atom container should be stored by the call.

DISCUSSION

The caller is responsible for disposing of the returned QT atom container.


MovieImportSetSettingsFromAtomContainer

The MovieImportSetSettingsFromAtomContainer routine sets the movie import component's current configuration from the passed settings data.

pascal ComponentResult MovieImportSetSettingsFromAtomContainer (
                    MovieImportComponent ci,
                    QTAtomContainer settings);

ci
The movie import component instance.
settings
Contains a QT atom container reference to the settings.

DISCUSSION

The settings QT atom container may contain atoms other than those expected by the particular component type or may be missing certain atoms. The function uses only those settings it understands.


Exporting Movie Data

This section describes new functions provided by movie data export components.

Since QuickTime 1.6.1, the sound movie export component has been updated to take advantage of Macintosh Sound Manager 3.0. Previously, only the first sound track in the movie was exported. Now sound tracks are mixed together before they are exported. If you want to use sound mixing, you can use the PutMovieIntoTypedHandle function to take advantage of the export component. Furthermore, you can now specify the format of the exported sound, so you can convert 16-bit sound to 8-bit sound or reduce stereo to monaural. See Inside Macintosh: QuickTime for a description of the PutMovieIntoTypedHandle function.


MovieExportGetAuxillaryData

QuickTime 1.6.1 added a new result code to this function. A movie export component returns the following result code when MovieExportGetAuxillaryData is called requesting a type of auxiliary data that the component cannot generate.

RESULT CODES

auxillaryExportDataUnavailable
-2058 Cannot generate the requested type of auxiliary data.

MovieExportSetSampleDescription

The MovieExportSetSampleDescription function allows your application to request the format of the exported data. This function is supported by the sound movie export component, for example. This function is not implemented by all movie export components.

pascal ComponentResult MovieExportSetSampleDescription(
                     MovieExportComponent ci,
                     SampleDescriptionHandle desc,
                     OSType mediaType);

ci
Specifies the movie component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
desc
Contains a handle to a valid QuickTime sample description.
mediaType
Indicates the type of media the sample description is for. For example, if the sample description was a sound description, this parameter would be set to SoundMediaType .

DISCUSSION

A movie export component may use all, some, or none of the settings from the sample description.

Some movie export components treat the sample description as part of their settings. If your application attempts to set the sample description using MovieExportSetSampleDescription, and receives the badComponentSelector error, you may need to pass in the sample description using the MovieExportSetSettingsFromAtomContainer function. You can use the MovieExportGetSettingsAsAtomContainer to obtain a correctly formatted atom container to modify.

RESULT Codes

badComponentInstance
0x80008001 Invalid movie export component instance
badComponentSelector
0x80008002 Function not supported

MovieExportValidate

The MovieExportValidate function allows your application to determine whether a movie export component can export all the data for a specified movie or track.

pascal ComponentResult MovieExportValidate(
                     MovieExportComponent ci,
                     Movie theMovie,
                     Track onlyThisTrack,
                     Boolean *valid);

ci
Specifies the movie export component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
theMovie
Specifies the movie to validate.
onlyThisTrack
Specifies a track within the movie to validate, or nil if the entire movie is to be validated.
valid
A pointer to a Boolean value. If the data for the movie or track can be exported by the component, the value is true .

DISCUSSION

MovieExportValidate allows an application to determine if a particular movie or track could be exported by the specified movie data export component. The movie or track is passed in the theMovie and onlyThisTrack parameters as they are passed to MovieExportToFile .

Although a movie export component can export one or more media types, it may not be able to export all the kinds of data stored in those media. The MovieExportValidate function allows applications to get this additional information.

Movie data export components that implement this function also set the canMovieExportValidateMovie flag in their component flags.

RESULT Codes

badComponentInstance
0x80008001 Invalid movie export component instance
badComponentSelector
0x80008002 Function not supported

Exporting Data from Sources Other Than Movies

This section describes new functions provided by movie data export components that allow applications to export data from sources other than movies.


MovieExportAddDataSource

The function allows you to define a data source for use with an export operation performed by MovieExportFromProceduresToDataRef .

pascal ComponentResult MovieExportAddDataSource (MovieExportComponent ci, OSType trackType,
                     TimeScale scale, long *trackID, MovieExportGetPropertyUPP
                     getPropertyProc, MovieExportGetDataUPP getDataProc, void *refCon);

ci
Identifies the Movie Toolbox's connection to your component.
trackType
Specifies the type of media provided by this data source. This normally corresponds to a QuickTime media type such as VideoMediaType or SoundMediaType .
scale
Specifies the time scale for time values passed to getDataProc parameter. If the source data is being taken from a QuickTime track, this value is typically the media's TimeScale .
trackID
Contains an identifier for the data source. This identifier is returned from the call.
getPropertyProc
Specifies a callback function that provides information about processing source samples.
getDataProc
Specifies a callback function the export component uses to request sample data.
refCon
Passed to the procedures specified in the getPropertyProc and getDataProc parameters.

DISCUSSION

Before starting an export operation, all the data sources must be defined by calling MovieExportAddDataSource once for each data source.


MovieExportFromProceduresToDataRef

The MovieExportFromProceduresToDataRef function exports data provided by MovieExportAddDataSource to a location specified by dataRef and dataRefType .

pascal ComponentResult MovieExportFromProceduresToDataRef (MovieExportComponent ci, Handle
                     dataRef,
                     OSType dataRefType);

ci
Specifies the movie component for the export operation.
dataRef
Specifies the data reference for the export operation.
dataRefType
Specifies the type identifier for the data reference specified by dataRef .

DISCUSSION

Movie data export components that support export operations from procedures must set the canMovieExportFromProcedures flag in their component flags.

Typically dataRef contains a Macintosh file alias and dataRefType is set to rAliasType .


MovieExportSetGetMoviePropertyProc

The MovieExportSetGetMoviePropertyProc function is used to specifry the procedure that the export component should call to retrieve movie level properties during MovieExportFromProceduresToDataRef .

pascal ComponentResult MovieExportSetGetMoviePropertyProc (
                     MovieExportComponent ci,
                     MovieExportGetPropertyUPP getPropertyProc,
                     void * refCon);

ci
Specifies the movie component for the export operation.
getPropertyProc
Specifies the procedure that the export component will call to retrieve movie level properties.
refCon
Specifies the refcon value that will be passed to the procedure getPropertyProc .

DISCUSSION

With QuickTime 4, applications can specify a MovieExportGetPropertyProc that will be called to retrieve movie level properties during the exporter's MovieExportFromProceduresToDataRef execution. This procedure is identical to a data source property procedure except that it is called for movie properties.

For example, the QuickTime movie export component may call the procedure with movieExportTimeScale to retrieve the time scale for the exported movie. If the property procedure is not specified or doesn't support this property, than the default movie time scale (600) is used.


MovieExportToDataRef

MovieExportToDataRef allows an application to request that data be exported to a data reference, instead of to a file.

pascal ComponentResult MovieExportToDataRef(MovieExportComponent ci, Handle dataRef, OSType
                     dataRefType, Movie theMovie, Track onlyThisTrack, TimeValue startTime,
                     TimeValue duration);

ci
Identifies the Movie Toolbox's connection to your component.
dataRef
Contains a handle to a data reference indicating where the data should be stored.
dataRefType
Specifies the type of the data reference. For exporting to a file, the dataRef is a Macintosh file alias and the dataRefType is rAliasType .
theMovie
Identifies the movie for this operation. This movie identifier is supplied by the toolbox. Your component may use this identifier to obtain sample data from the movie or to obtain information about the movie.
onlyThisTrack
Identifies a track that is to be converted. This track identifier is supplied by the toolbox. If this parameter contains a track identifier, your component must convert only the specified track.
startTime
Specifies the starting point of the track or movie segment to be converted. This time value is expressed in the movie's time coordinate system.
duration
Specifies the duration of the track or movie segment to be converted. This duration value is expressed in the movie's time coordinate system.

MovieExportGetSettingsAsAtomContainer

The MovieExportGetSettingsAsAtomContainer routine retrieves the current settings from the movie export component.

pascal ComponentResult MovieExportGetSettingsAsAtomContainer (
                     MovieExportComponent ci,
                     QTAtomContainer *settings);

ci
The movie export component instance.
settings
The address where the newly-created atom container should be stored by the call.

DISCUSSION

The caller is responsible for disposing of the returned QT atom container.

Applications programmers can call this function to obtain a correctly formatted atom container to use with MovieExportSetSettingsFromAtomContainer . This might be done after a call to MovieExportDoUserDialog , for example, to apply the user-obtained settings to a series of exports.


MovieExportSetSettingsFromAtomContainer

The MovieExportSetSettingsFromAtomContainer routine sets the movie export component's current configuration from the passed settings data.

pascal ComponentResult MovieExportSetSettingsFromAtomContainer (
                     MovieExportComponent ci,
                     QTAtomContainer settings);

ci
The movie export component instance.
settings
This contains a QT atom container reference to the settings.

DISCUSSION

The settings QT atom container may contain atoms other than those expected by the particular component type or may be missing certain atoms. The MovieExportSetSettingsFromAtomContainer routine uses only those settings it understands.

Applications programmers should be aware that some movie export components treat sample descriptions as part of their settings. If your application attempts to set the sample description using MovieExportSetSampleDescription, and receives the badComponentSelector error, you may need to pass in the sample description using the MovieExportSetSettingsFromAtomContainer function. You can use the MovieExportGetSettingsAsAtomContainer to obtain a correctly formatted atom container that you can then modify.


Functions Provided by the QuickTime Movie Export Component

This section documents routines provided by the QuickTime movie export component. These functions can be used by other data export components to implement their own functionality.


MovieExportNewGetDataAndPropertiesProcs

MovieExportNewGetDataAndPropertiesProcs returns MovieExportGetProperty and MovieExportGetData procedures that can be passed to MovieExportAddDataSource to create a new data source. This function exists in order to provide a standard way of getting data using this protocol out of a movie or track.

pascal ComponentResult MovieExportNewGetDataAndPropertiesProcs (MovieExportComponent ci,
                     OSType trackType, TimeScale *scale, Movie theMovie, Track theTrack,
                     TimeValue startTime, TimeValue duration, MovieExportGetPropertyUPP
                     *getPropertyProc, MovieExportGetDataUPP *getDataProc, void **refCon);

ci
Identifies the Movie Toolbox's connection to your component.
trackType
Specifies the format of the data to be generated by the returned getDataProc .
scale
The time scale is returned from this function, and should be passed on to MovieExportAddDataSource with the procedures.
theMovie
Identifies the movie for this operation. This movie identifier is supplied by the toolbox. Your component may use this identifier to obtain sample data from the movie or to obtain information about the movie.
theTrack
Identifies the track for this operation. This track identifier is supplied by the toolbox.
startTime
Specifies the starting point of the track or movie segment to be converted. This time value is expressed in the movie's time coordinate system.
duration
Specifies the duration of the track or movie segment to be converted. This duration value is expressed in the movie's time coordinate system.
getPropertyProc
Specifies a callback function that provides information about processing source samples.
getDataProc
Specifies a callback function the export component uses to request sample data.
refCon
Passed to the procedures specified in the getPropertyProc and getDataProc parameters.

DISCUSSION

This function is only implemented by movie data export components. The returned procedures must be disposed by calling MovieExportDisposeGetDataAndPropertiesProc .


MovieExportDisposeGetDataAndPropertiesProcs

Disposes of the memory associated with the procedures returned by MovieExportNewGetDataAndPropertiesProcs.

pascal ComponentResult MovieExportDisposeGetDataAndPropertiesProcs (MovieExportComponent ci,
                     MovieExportGetPropertyUPP getPropertyProc, MovieExportGetDataUPP
                     getDataProc, void *refCon);

ci
Identifies the Movie Toolbox's connection to your component.
getPropertyProc
Specifies a callback function that provides information about processing source samples.
getDataProc
Specifies a callback function the export component uses to request sample data.
refCon
Passed to the procedures specified in the getPropertyProc and getDataProc parameters.

Application-Defined Functions

The MovieExportGetPropertyProcPtr and MovieExportGetDataProcPtr routines are closely associated with MovieExportFromProcedures .


MovieExportGetPropertyProcPtr

You use MovieExportGetPropertyProcPtr to return parameters that determine the appropriate format for the output data.

typedef pascal OSErr (*MovieExportGetPropertyProcPtr)(void *refcon,
                     long trackID, OSType propertyType,
                     void *propertyValue);

refCon
Contains the value passed to MovieExportAddDataSource in the refCon parameter.
trackID
Specifies the value returned from MovieExportAddDataSource .
propertyValue
Contains a pointer to the location of the requested property information.
propertyType
Specifies the property being requested. All currently defined property types are listed in Table 2 .
propertyType
 

Table 2 Currently supported property types 

Property

Type

Track Type

scSoundSampleRateType
UnsignedFixed
sound
scSoundSampleSizeType
short
sound
scSoundChannelCountType
short
sound
scSoundCompressionType
OSType
sound
movieExportWidth
Fixed
video
movieExportHeight
Fixed
video
movieExportVideoFilter
Pointer to QTAtomContainer
video
scSpatialSettingsType
SCSpatialSettings
video
scTemporalSettingsType
SCTemporalSettings
video
scDataRateSettingsType
SCDataRateSettings
video
movieExportDuration
TimeRecord
movie

DISCUSSION

The function defined by MovieExportGetPropertyProcPtr type is passed to MovieExportAddDataSource to define a new data source for an export operation. For example, a video export operation may call the function to determine the dimensions of the destination video track.

If the function doesn't have a setting for a requested property, it should return an error. The export component provides a default value for the property based on the source data format. For example, if no values for video track width and height properties were provided by the callback function, the dimensions of the source data would be used.


MovieExportGetDataProcPtr

You use the function defined by MovieExportGetDataProcPtr to define a data source for an export operation.

typedef pascal OSErr (*MovieExportGetDataProcPtr)(void *refCon, MovieExportGetDataParams
                     *params);

The sample request is made through a parameter block. The data structure used is shown below.

struct MovieExportGetDataParams {
    long                        recordSize;
    long                        trackID;
    TimeScale                   sourceTimeScale;
    TimeValue                   requestedTime;
    TimeValue                   actualTime;
    Ptr                         dataPtr;
    long                        dataSize;
    SampleDescriptionHandle     desc;
    OSType                      descType;
    long                        descSeed;
    long                        requestedSampleCount;
    long                        actualSampleCount;
    TimeValue                   durationPerSample;
    long                        sampleFlags;
};

typedef struct MovieExportGetDataParams MovieExportGetDataParams;
refCon
Contains the value passed to MovieExportAddDataSource in the refCon parameter.
recordSize
Contains the total size in bytes of the MovieExportGetDataParams structure. This is provided to allow for additional parameters to be added safely in the future.
trackID
Specifies the data source. The trackID is returned when the data source is added by calling MovieExportAddDataSource .
sourceTimeScale
Specifies the time scale for this data source. This value is the same time scale that is passed to MovieExportAddDataSource .
requestedTime
Specifies the time of the media requested by the exporter. The time scale is the same one specified when adding a data source with MovieExportAddDataSource .
actualTime
Specifies the time actually referred to by the returned media data. This value is provided by MovieExportGetDataProcPtr, and is usually the same as requestedTime .
dataPtr
Contains a 32-bit pointer to the media data.
dataSize
Specifies the size in bytes of the data pointed to by dataPtr.
desc
Contains a SampleDescriptionHandle describing the format of the data pointed to by dataPtr . For video data, this is an ImageDescriptionHandle . For sound data, this is a SoundDescriptionHandle .
descType
Specifies the type of SampleDescriptionHandle . For example, if SampleDescriptionHandle is ImageDescriptionHandle, descType is set to VideoMediaType .
descSeed
Specifies which SampleDescriptionHandle represented by the current value of desc . Some data sources contain different kinds of data at different times. For example, a video data source may contain both JPEG and uncompressed raw data. Whenever the data source switches from one type of data to another, change descSeed to notify the exporter. In the case of an export operation that is providing its source data from a QuickTime movie track, descSeed is equal to the sample description index of the sample being returned.
requestedSampleCount
Specifies the number of samples the exporter can work with. The function can return more or fewer samples than requested. For video, this value is always 1.
actualSampleCount
Specifies the number of samples actually returned. The function must fill in this field.
durationPerSample
Specifies the duration of every sample returned. For sound data, durationPerSample always contains 1. For video data, durationPerSample contains the duration of the returned sample, expressed in the time scale defined when the data source was created.
sampleFlags
Contains the flags for the returned samples. The only defined flag is mediaSampleNotSync , which is usually only returned for frame-differenced video sample data. The function must fill in this field.

DISCUSSION

The function defined by the MovieExportGetDataProcPtr type is passed to MovieExportAddDataSource to define a new data source for an export operation. The function is used by the exporting application to request source media data to be used in the export operation. For example, in a video export operation, frames of video data (either compressed or uncompressed) are provided. In a sound export operation, buffers of audio (either compressed or uncompressed) are provided.

The data pointed to by dataPtr must remain valid until the next call to this MovieExportGetDataProcPtr function. The MovieExportGetDataProcPtr function is responsible for allocating and disposing of the memory associated with this data pointer.

Movie Data Exchange Component Resources

With QuickTime 4, data exchange components of both types declare public component resources that are useful to applications and QuickTime. Because these are public component resources, a number of benefits arise. First, clients can access the data without having to open the components which would require the code to be loaded and called. Second, since the resources have well known types and ids it is not necessary to define new component functions on the components just to retrieve the data. In some cases, older component routines may not need to be called if the data exchange component has a public component resource of the appropriate type. Finally, since component resources are cached, subsequent access to the data will typically be quite fast.

 


© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |